import com.sun.org.apache.bcel.internal.generic.BREAKPOINT;

import java.io.*;
import java.net.Socket;

public class Client {
    public static void main(String[] args) {
        Socket s = null;
        try {
            s = new Socket("127.0.0.1",3333);
            BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
            bw.write("hello");
            bw.newLine();
            bw.flush();
            BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
            System.out.println(br.readLine());
            bw.close();
            br.close();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (s != null){
                try {
                    s.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
